//
//  BanTangViewController.m
//  07-homeWork周末作业
//
//  Created by 402030900@qq.com on 16/7/23.
//  Copyright © 2016年 402030900@qq.com. All rights reserved.
//

#import "BanTangViewController.h"
#import "BangTangViewController1.h"
#import "BanTangViewController2.h"
#import "BanTangViewController3.m"
#import "BanTangViewController4.h"
@interface BanTangViewController ()

@end

@implementation BanTangViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    // 自定义tabBar
    UIView * tabBar = [[UIView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height - 49, self.view.frame.size.width, 49)];
    tabBar.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:tabBar];
    UIButton * button1 = [UIButton buttonWithType:(UIButtonTypeSystem)];
    [button1 setFrame:CGRectMake(0, 0, self.view.frame.size.width / 4, 39)];
    button1.backgroundColor = [UIColor whiteColor];
    [tabBar addSubview:button1];
    UIButton * button2 = [UIButton buttonWithType:(UIButtonTypeSystem)];
    [button2 setFrame:CGRectMake(self.view.frame.size.width / 4, 0, self.view.frame.size.width / 4, 39)];
    button2.backgroundColor = [UIColor whiteColor];
    [tabBar addSubview:button2];
    UIButton * button3 = [UIButton buttonWithType:(UIButtonTypeSystem)];
    [button3 setFrame:CGRectMake(self.view.frame.size.width / 2, 0, self.view.frame.size.width / 4, 39)];
    button3.backgroundColor = [UIColor whiteColor];
    [tabBar addSubview:button3];
    UIButton * button4 = [UIButton buttonWithType:(UIButtonTypeSystem)];
    [button4 setFrame:CGRectMake(self.view.frame.size.width * 3 / 4, 0, self.view.frame.size.width / 4, 39)];
    button4.backgroundColor = [UIColor whiteColor];
    [tabBar addSubview:button4];
    UIImageView * imageView1 =[[UIImageView alloc] initWithFrame:CGRectMake((self.view.frame.size.width / 4 - 39) / 2, 0, 39, 39)];
    imageView1.backgroundColor = [UIColor whiteColor];
    imageView1.image = [UIImage imageNamed:@"首页"];
    [button1 addSubview:imageView1];
    UIImageView * imageView2 =[[UIImageView alloc] initWithFrame:CGRectMake((self.view.frame.size.width / 4 - 39) / 2, 0, 39, 39)];
    imageView2.backgroundColor = [UIColor whiteColor];
    imageView2.image = [UIImage imageNamed:@"zhinanzhen"];
    [button2 addSubview:imageView2];
    UIImageView * imageView3 =[[UIImageView alloc] initWithFrame:CGRectMake((self.view.frame.size.width / 4 - 39) / 2, 0, 39, 39)];
    imageView3.backgroundColor = [UIColor whiteColor];
    imageView3.image = [UIImage imageNamed:@"email"];
    [button3 addSubview:imageView3];
    UIImageView * imageView4 =[[UIImageView alloc] initWithFrame:CGRectMake((self.view.frame.size.width / 4 - 39) / 2, 0, 39, 39)];
    imageView4.backgroundColor = [UIColor whiteColor];
    imageView4.image = [UIImage imageNamed:@"my"];
    [button4 addSubview:imageView4];
    [button1 addTarget:self action:@selector(clickButton1:) forControlEvents:(UIControlEventTouchUpInside)];
    [button2 addTarget:self action:@selector(clickButton2:) forControlEvents:(UIControlEventTouchUpInside)];
    [button3 addTarget:self action:@selector(clickButton3:) forControlEvents:(UIControlEventTouchUpInside)];
   
    [button4 addTarget:self action:@selector(clickButton4:) forControlEvents:(UIControlEventTouchUpInside)];
    
    // Do any additional setup after loading the view.
}
-(void)clickButton1:(UIButton *)button {
    BangTangViewController1 * ban1 = [[BangTangViewController1 alloc] init];
    [self presentViewController:ban1 animated:YES completion:nil];
}
-(void)clickButton2:(UIButton *)button {
    BanTangViewController2 * ban2 = [[BanTangViewController2 alloc] init];
    [self presentViewController:ban2 animated:YES completion:nil];
}
-(void)clickButton3:(UIButton *)button {
    BanTangViewController3 * ban3 = [[BanTangViewController3 alloc] init];
    [self presentViewController:ban3 animated:YES completion:nil];
}
-(void)clickButton4:(UIButton *)button {
    BanTangViewController4 * ban4 = [[BanTangViewController4 alloc] init];
    [self presentViewController:ban4 animated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
